package com.exampl.breakfastapp;

import android.os.Bundle;
import android.app.Activity;
import android.view.Menu;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity extends Activity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        et_input = (EditText) findViewById(R.id.input);
        b_save = (Button) findViewById(R.id.save);
        tv_output = (TextView) findViewById(R.id.output);
        b_save.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
               tv_output.setText("I am glad that your breakfast was: " + et_input.getText().toString());
               et_input.setText("");
            }
        });
    }


    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return true;
    }

    EditText et_input;
    Button b_save;
    TextView tv_output;

    
}
